package com.hc.wdj.core.application;

import org.apache.commons.lang3.StringUtils;

/**
 * @author ryanwdj
 * @since 2024/11/20
 */
public class ApplicationInfo {

    /**
     * 应用前缀
     */
    public static String routePrefix;

    /**
     * 为指定 path 裁剪掉routePrefix前缀
     * @param path
     * @return
     */
    public static String cutPathPrefix(String path){
        if( !StringUtils.isEmpty(routePrefix) && !"/".equals(routePrefix) && path.startsWith(routePrefix)){
            path = path.substring(routePrefix.length());
        }
        return path;
    }
}
